package com.cxl.parser;   
import org.htmlparser.Parser;   
import org.htmlparser.PrototypicalNodeFactory;   
import org.htmlparser.lexer.Lexer;   
import org.htmlparser.util.ParserException;
import org.htmlparser.util.ParserFeedback;   
/**   
 * @（#）:MyParser.java   
 * @description:  继承自Parser的类,对Parser进行扩展  
 * @author:  zx  2010-12-9   
 */  
public class MyParser extends Parser {   
    private static PrototypicalNodeFactory factory = null;   
    //注册自定义标签   
    static{   
        factory = new PrototypicalNodeFactory();   
        factory.registerTag(new FontTag());   
        factory.registerTag(new StrongTag());   
        factory.registerTag(new BTag());
        factory.registerTag(new SpanTag());
        factory.registerTag(new EmTag());
        factory.registerTag(new LiTag());
    }
    
    public MyParser(){   
        super();   
        setNodeFactory(factory);   
    }   
    
    public MyParser(String url) throws ParserException{   
        super(url);
        setNodeFactory(factory);   
    }   
       
    public MyParser(Lexer lexer, ParserFeedback fb) {   
        super(lexer, fb);   
        setNodeFactory(factory);   
    }   
       
}  


